﻿DECLARE @SQL NVARCHAR(MAX)

SET @SQL = ''

SELECT @SQL += OBJECT_DEFINITION(objects.Object_id) + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10)
FROM sys.objects objects
WHERE objects.schema_id = SCHEMA_ID('QIC')
AND objects.type IN ('P','IF','TF','FN')

EXEC QIC.LongPrint @SQL
